<?php
/* 
 *发货小分单管理
 */
class Shipping_detailAction extends CommonAction {
    public function insert2()
    {
        $sid =  $_GET['sid'];
        $odid = $_GET['odid'];
        if(empty($sid) || empty($odid) )
            $this->error('发货单号或小订单号必须！');
        $_POST['shipping_id'] = $sid;
        $_POST['order_detail_id'] = $odid;
        $map = array(
            'shipping_id' => $sid,
            'order_detail_id' => $odid,
            );
        
        $jumpUrl = __APP__.'/Shipping/detail/id/'.$sid;
        $rs = M('Shipping_detail')->where($map)->findAll();
        if(!is_array($rs)){
            $order_detail = M('Order_detail');
            $order_detail->getById($odid);
            $_POST['product_id'] = $order_detail->product_id;
            $_POST['number'] = $order_detail->number;
            $_POST['total'] = $order_detail->total;
            parent::insert($jumpUrl);
        }
            
    }
}
?>
